package WinterHomework.day16;

//数组逆序打印，递归实现
public class Demo01 {
    public static void main(String[] args) {
        int[] arr = {1,3,5,7,9};
        printArray(arr,arr.length);
    }
    public static void printArray(int[] array,int len) {
        if (len == 1) {
            System.out.println(array[0]);
            return;
        }
        System.out.println(array[len - 1]);
        printArray(array,len - 1);
    }
}
